package Demo07;

import org.w3c.dom.ls.LSOutput;

import java.util.ArrayList;

public class Demo01ArrrayListPrint {
    public static void main(String[] args) {
        ArrayList<String> list = new ArrayList<>();
        list.add("笨蛋");
        list.add("傻瓜");
        list.add("猪八戒");
        list.add("卧槽");
        System.out.println(list);
        printArrayList(list);
    }
    public static void printArrayList(ArrayList<String> list){
        System.out.print("{");
        for (int i = 0; i <list.size() ; i++) {
            String name = list.get(i);
            if (i == list.size() - 1) {
                System.out.println(name + "}");
            }else{
                System.out.print(name + "@");
            }
        }
    }
}
